//
//  SXModel.m
//  W2MD
//
//  Created by 海明洋 on 14/12/30.
//  Copyright (c) 2014年 zhudongwei. All rights reserved.
//

#import "SXModel.h"

@implementation SXModel
static SXModel *_shareModel;
+ (SXModel *)shareModel
{
    @synchronized(self){
        if (!_shareModel) {
            _shareModel=[[self alloc]init];
        }
    }
    return _shareModel;
}

-(id)init
{
    self=[super init];
    if (self) {
        self.chunseban=NO;
        self.zhuseban=NO;
        self.peiseban=NO;
        self.wuzhuseban=NO;
        self.kuanshi=NO;
        self.touming=NO;
        self.yanseshuxing=NO;
        self.kuanshi2=NO;
        self._4CV=NO;
        self.juBuPeiSe=YES;
        self.siwa=NO;
        self.level2CV=NO;
        self.imgInfo=NO;
        self.swipeUp=NO;
        self.swiped=NO;
        self.wifi=NO;
        self.finishLoading=NO;
        self.scrolled=NO;
        self.infoArr=[[NSMutableArray alloc] init];
        self.colorArr=[[NSMutableArray alloc] init];
        self.clothesItemArr=[[NSMutableArray alloc] init];
        self.colorIndex=0;
        self.customIndex=0;
        self.refresh=NO;
        self.searched=NO;
        self.pageOver=NO;
        self.addClothes=NO;
        self.createKuanshi=NO;
        self.isZhuSe=NO;
        self.isKuanshi=NO;
        self.tuanAction=NO;
        self.peiseAction=NO;
        self.isKuanshiDic=[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO],@"0",[NSNumber numberWithBool:NO],@"1",[NSNumber numberWithBool:NO],@"2",[NSNumber numberWithBool:NO],@"3", nil];
        self.labelArr=[[NSMutableArray alloc] init];
        self.originLabel=[[UILabel alloc] init];
        self.createTuan=NO;
        self.createPeise=NO;
        self.zhuse=NO;
        self.clickItem=NO;
        self.Arrow=NO;
        self.segValue=10;
        self.tuanIndex=0;
        self.selectedTuanArr=[[NSMutableArray alloc] init];
        self.selectedPeiseArr=[[NSMutableArray alloc] init];
        self.labelFactorArr=[[NSMutableArray alloc] init];
        self.selectedTuanDic=[[NSMutableDictionary alloc] init];
        self.selectedPeiseDic=[[NSMutableDictionary alloc] init];
        self.timeArr=[NSMutableArray arrayWithObjects:@"上午",@"下午", nil];
        self.hourArr=[NSMutableArray arrayWithObjects:@"12",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",nil];
        self.minuteArr=[NSMutableArray arrayWithObjects:@"00",@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",nil];
        for (int i=10; i<=59; i++) {
            [self.minuteArr addObject:[NSString stringWithFormat:@"%d",i]];
        }
        self.timeIndex=0;
        self.hourIndex=605;
        self.minuteIndex=1500;
        self.openWeek=NO;
        self.weekArr=[[NSMutableArray alloc] init];
        self.weekIndexArr=[[NSMutableArray alloc] init];
        self.alarmArr=[[NSMutableArray alloc] init];
        NSMutableArray *arr=[NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"ALARMARR"]];
        if (arr) {
            self.alarmArr=arr;
        }
        
        self.alarmWeekArr=[[NSMutableArray alloc] init];
        NSMutableArray *arrWeek=[NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"ALARMWEEK"]];
        if (arrWeek) {
            self.alarmWeekArr=arrWeek;
        }
        self.alarmWeekIndexArr=[[NSMutableArray alloc] init];
        NSMutableArray *arrWeekIndex=[NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"ALARMWEEKINDEX"]];
        if (arrWeekIndex) {
            self.alarmWeekIndexArr=arrWeekIndex;
        }
        
        self.selectArr=[[NSMutableArray alloc] initWithObjects:@"帽子",@"眼镜",@"披戴类",@"上装",@"裤子",@"裙子",@"连体装",@"包包",@"袜子",@"鞋子",@"上装二层",@"上装三层",nil];
        self.noti=NO;
        self.clockSetOpen=NO;
        self.clockSelectOpen=0;
        self.clickedNo=NO;
        self.chaKan=NO;
        self.changeClock=NO;
        self.localNotiArr=[[NSMutableArray alloc] init];
        NSMutableArray *notiArr=[NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"NOTIARR"]];
        if (notiArr) {
            self.localNotiArr=notiArr;
        }
        
        self.segIndexArr=[[NSMutableArray alloc] init];
        NSMutableArray *segArr=[NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"SEGARR"]];
        if (segArr) {
            self.segIndexArr=segArr;
        }
        
        self.morenSeg=2;
        self.sleepMore=NO;
        self.sleepMoreOpen=[[NSMutableArray alloc] init];
        NSMutableArray *sleepMoreArr=[NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"SLEEPMOREOPEN"]];
        if (sleepMoreArr) {
            self.sleepMoreOpen=sleepMoreArr;
        }
        
        self.notificaiton=[[UILocalNotification alloc] init];
        self.startSelect=NO;
        self.refreshData=NO;
    }
    return self;
}

@end
